<!--咨询留言-->
<template>
	<view>
		<view class="box">
			<view class="title_box">
				<label>所属分类</label>
				<span class="right" @click="hrefList">已选择科室问题，感冒问题，其他问题</span>
			</view>
			<view class="content_box">
				<textarea placeholder="请仔细描述您的问题"></textarea>
				<view class="astrict"><span>0/180</span></view>
			</view>
			<view class="image_box">
				<ul>
					<li v-for="(item,index) in imageList" :key="index">
						<icon @click="clearImage(index)" type="clear" color="rgba(0, 0, 0)" size="30px"  style="position: absolute; z-index: 99999;right: 0;top:0;border-radius: 50%;overflow: hidden;">
						</icon>
						<image :src="item" mode="scaleToFill" style="width: 100%;height: 100%;"></image>
					</li>
					<li  @click="uploadFile">
						<view><label>添加图片</label></view>
					</li>
				</ul>
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				imageList:[]
			}
		},
		onLoad(){
			
		},
		methods:{
			init(){
				
			},
			uploadFile(){
				let _this=this;
				uni.chooseImage({
					success(res) {
						_this.imageList.push(res.tempFilePaths[0]);
					}
				})
			},
			clearImage(index){
				this.imageList.splice(index,1);
			},
			hrefList(){
				uni.navigateBack({
					delta:1
				})
			}
		}
	}
</script>

<style>
.title_box{
	width: 94%;
	background-color: #FFFFFF;
	padding: 10px;
}
.title_box span{
	font-size: 14px;
	color: #999999;
	
}
.content_box{
	margin-top: 10px;
	background-color: #FFFFFF;
	padding: 10px;
}
.content_box textarea{
	margin: 0 auto;
	border-radius: 4px;
	border: 1px solid #E1E1E1;
	padding: 10px;
	font-size: 14px;
}
.content_box .astrict{
	width: 94%;
	text-align: right;
	color: #666666;
	padding: 10px;
}
.image_box {
	width: 100%;
	margin-top: 10px;
}
.image_box ul li{
	position: relative;
	overflow: hidden;
	width: 30%;
	height: 100px;
	background-color: #C3C3C3;
	float: left;
	margin-left: 7px;
	font-size: 90px;
	justify-content: center;
	border-radius: 12px;
	margin-top: 10px;
	border: 1px solid #E1E1E1;
	
}
.image_box ul li:last-child{
	background-color: #E6E6E6;
	text-align: center;
	font-size: 14px;
}
.image_box ul li:last-child::before{
	content: "+";
	font-size: 4em;
	align-items: center;
	padding: 0;
	margin: 0;
	justify-content: center;
	font-weight: 100;
}
</style>
